﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace B.S.ReportEvent.Infrastructure.Migrations
{
    public partial class 创建应用实例和审批记录 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "ProcessRecords",
                columns: table => new
                {
                    RecordId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InstanceId = table.Column<int>(type: "int", nullable: false),
                    FormTypeNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormTypeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NodeNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NodeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OperatorId = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OperatorName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OperatorOpinion = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ApproveStatus = table.Column<int>(type: "int", nullable: false),
                    ApproveStatusName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDeleted = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProcessRecords", x => x.RecordId);
                });

            migrationBuilder.CreateTable(
                name: "WfInstances",
                columns: table => new
                {
                    InstanceId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FormTypeNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormTypeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormContent = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FlowStatus = table.Column<int>(type: "int", nullable: false),
                    FlowStatusName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    StarterId = table.Column<int>(type: "int", nullable: false),
                    StarterName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CurrentNodeNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CurrentNodeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CurrentOperatorId = table.Column<int>(type: "int", nullable: false),
                    CurrentOperatorName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NextNodeNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NextNodeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NextOperatorId = table.Column<int>(type: "int", nullable: false),
                    NextOperatorName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
                    FormId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WfInstances", x => x.InstanceId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "ProcessRecords");

            migrationBuilder.DropTable(
                name: "WfInstances");
        }
    }
}
